import 'package:cbec_app/generated/json/base/json_convert_content.dart';
import 'package:cbec_app/components/decoration/DecorationGoodsGroup/goods_group_header_tab_item_entity.dart';

GoodsGroupHeaderTabItemEntity $GoodsGroupHeaderTabItemEntityFromJson(Map<String, dynamic> json) {
  final GoodsGroupHeaderTabItemEntity goodsGroupHeaderTabItemEntity = GoodsGroupHeaderTabItemEntity();
  final bool? isShowAll = jsonConvert.convert<bool>(json['isShowAll']);
  if (isShowAll != null) {
    goodsGroupHeaderTabItemEntity.isShowAll = isShowAll;
  }
  final int? goodsNumber = jsonConvert.convert<int>(json['goods_number']);
  if (goodsNumber != null) {
    goodsGroupHeaderTabItemEntity.goodsNumber = goodsNumber;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    goodsGroupHeaderTabItemEntity.createTime = createTime;
  }
  final String? tagName = jsonConvert.convert<String>(json['tag_name']);
  if (tagName != null) {
    goodsGroupHeaderTabItemEntity.tagName = tagName;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    goodsGroupHeaderTabItemEntity.name = name;
  }
  final int? channelNum = jsonConvert.convert<int>(json['channelNum']);
  if (channelNum != null) {
    goodsGroupHeaderTabItemEntity.channelNum = channelNum;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    goodsGroupHeaderTabItemEntity.id = id;
  }
  return goodsGroupHeaderTabItemEntity;
}

Map<String, dynamic> $GoodsGroupHeaderTabItemEntityToJson(GoodsGroupHeaderTabItemEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['isShowAll'] = entity.isShowAll;
  data['goods_number'] = entity.goodsNumber;
  data['createTime'] = entity.createTime;
  data['tag_name'] = entity.tagName;
  data['name'] = entity.name;
  data['channelNum'] = entity.channelNum;
  data['id'] = entity.id;
  return data;
}

extension GoodsGroupHeaderTabItemEntityExtension on GoodsGroupHeaderTabItemEntity {
  GoodsGroupHeaderTabItemEntity copyWith({
    bool? isShowAll,
    int? goodsNumber,
    String? createTime,
    String? tagName,
    String? name,
    int? channelNum,
    String? id,
  }) {
    return GoodsGroupHeaderTabItemEntity()
      ..isShowAll = isShowAll ?? this.isShowAll
      ..goodsNumber = goodsNumber ?? this.goodsNumber
      ..createTime = createTime ?? this.createTime
      ..tagName = tagName ?? this.tagName
      ..name = name ?? this.name
      ..channelNum = channelNum ?? this.channelNum
      ..id = id ?? this.id;
  }
}
